package org.micode.libs.dao.base;

import org.micode.common.domain.base.BaseEntity;
import org.apache.ibatis.annotations.Param;

/**
 * 实体类的读取器基类
 */
public interface BaseAllDao<T extends BaseEntity> extends BaseEditDao<T> {

    /**
     * 做删除标记
     *
     * @param key
     * @param currentUserId
     * @param clientAppName
     * @param clientIpAddress
     * @return
     */
    int updateForDelete(@Param("key") Object key,
                        @Param("currentUserId") Long currentUserId,
                        @Param("clientAppName") String clientAppName,
                        @Param("clientIpAddress") String clientIpAddress);

    int updateForDeleteByKeys(@Param("keys") String keys,
                              @Param("currentUserId") Long currentUserId,
                              @Param("clientAppName") String clientAppName,
                              @Param("clientIpAddress") String clientIpAddress);
    /**
     * 删除数据库里面的数据
     *
     * @param example
     * @return
     */
    int updateForDeleteByExample(@Param("example") T example,
                                 @Param("currentUserId") Long currentUserId,
                                 @Param("clientAppName") String clientAppName,
                                 @Param("clientIpAddress") String clientIpAddress);

}
